Skip to content

Conversation

@dervoeti
Copy link
Member

The args to jq were not parsed correctly, which resulted in e.g.

...
"purl": "$purl",
...

in the final JSON of the SBOM.

I could not figure out how to concatenate the two args with jq ($name and $description) so I concatenated both variables with Shellscript into one arg for jq.

@razvan
Copy link
Member

razvan commented Sep 10, 2024

I could not figure out how to concatenate the two args with jq ($name and $description) so I concatenated both variables with Shellscript into one arg for jq.

Have you tried join() ?

@dervoeti
Copy link
Member Author

I could not figure out how to concatenate the two args with jq ($name and $description) so I concatenated both variables with Shellscript into one arg for jq.

Have you tried join() ?

Yeah, couldn't make it work. But I didn't try too much since joining the string with Shellscript works fine and shouldn't be a problem.

@NickLarsenNZ
Copy link
Member

I have concatenated via \($a\) \($b\), eg:

❯ jq -n --arg a hello --arg b world '"\($a) \($b)"'
"hello world"

Copy link
Member

@NickLarsenNZ NickLarsenNZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left another comment on how to concat with jq for future reference.

@dervoeti dervoeti added this pull request to the merge queue Sep 11, 2024
Merged via the queue into main with commit f3aaed0 Sep 11, 2024
1 check passed
@dervoeti dervoeti deleted the fix/jq-sbom-metadata branch September 11, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants